//
//  HJDResigrRecordTableViewCell.m
//  JYHospital
//
//  Created by 胡金东 on 16/6/20.
//  Copyright © 2016年 胡金东. All rights reserved.
//





#import "HJDResigrRecordTableViewCell.h"

@implementation HJDResigrRecordTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.desk = [[UILabel alloc]initWithFrame:CGRectZero];
        self.desk.textColor = [UIColor getColorWithHexNumber:@"323232"];
        self.desk.font = [UIFont systemFontOfSize:19];
        [self addSubview:self.desk];
        
        self.hosName = [[UILabel alloc]initWithFrame:CGRectZero];
        self.hosName.textColor = [UIColor getColorWithHexNumber:@"A4A4A4"];
        self.hosName.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.hosName];
        
        self.state = [[UILabel alloc]initWithFrame:CGRectZero];
        self.state.textColor = [UIColor getColorWithHexNumber:@"A4A4A4"];
        self.state.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.state];
        
        self.shuView = [[UIView alloc]initWithFrame:CGRectZero];
        self.shuView.backgroundColor = [UIColor getColorWithHexNumber:@"D6D6D6"];
      
        [self addSubview:self.shuView];
        
        self.imgView = [[UIImageView alloc]initWithFrame:CGRectZero];
        self.imgView.image = [UIImage imageNamed:@"椭圆"];
        [self addSubview:self.imgView];
        
        self.day = [[UILabel alloc]initWithFrame:CGRectZero];
        self.day.textColor = [UIColor getColorWithHexNumber:@"323232"];
        self.day.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.day];
        
        self.month = [[UILabel alloc]initWithFrame:CGRectZero];
        self.month.textColor = [UIColor getColorWithHexNumber:@"323232"];
        self.month.font = [UIFont systemFontOfSize:15];
        [self addSubview:self.month];
        
        self.year = [[UILabel alloc]initWithFrame:CGRectZero];
        self.year.textColor = [UIColor getColorWithHexNumber:@"A4A4A4"];
        self.year.font = [UIFont systemFontOfSize:13];
        [self addSubview:self.year];
        
        self.hengView = [[UIView alloc]initWithFrame:CGRectZero];
        self.hengView.backgroundColor = [UIColor getColorWithHexNumber:@"D6D6D6"];
        [self addSubview:self.hengView];
        
        
    }
    return self;
}

-(void)layoutSubviews{

    CGFloat deskX = HJDHorizontalMargin/2;
    CGFloat deskY = HJDVerticalMargin;
    CGFloat deskW = 100;
    CGFloat deskH = 30;
    self.desk.frame = CGRectMake(deskX, deskY, deskW, deskH);
    
    CGFloat hosNameX = HJDHorizontalMargin/2;
    CGFloat hosNameY = CGRectGetMaxY(self.desk.frame) + HJDVerticalMargin;
    CGFloat hosNameW = 140;
    CGFloat hosNameH = 20;
    self.hosName.frame = CGRectMake(hosNameX, hosNameY, hosNameW, hosNameH);
    
    CGFloat stateX = CGRectGetMaxX(self.hosName.frame) + HJDHorizontalMargin ;
    CGFloat stateY = CGRectGetMaxY(self.desk.frame) + HJDVerticalMargin;
    CGFloat stateW = 80;
    CGFloat stateH = 20;
    self.state.frame = CGRectMake(stateX, stateY, stateW, stateH);
    
    
    CGFloat imgViewX = HJDWidth -60-30 ;
    CGFloat imgViewY = 44;
    CGFloat imgViewW = 12;
    CGFloat imgViewH = 12;
    self.imgView.frame = CGRectMake(imgViewX, imgViewY, imgViewW, imgViewH);

    
    CGFloat shuViewX = imgViewX + 6;
    CGFloat shuViewY = 0;
    CGFloat shuViewW = 1;
    CGFloat shuViewH = 101;
    self.shuView.frame = CGRectMake(shuViewX, shuViewY, shuViewW, shuViewH);
    
    CGFloat monthX = HJDWidth - 40 - 20;
    CGFloat monthY = 47;
    CGFloat monthW = 20;
    CGFloat monthH = 20;
    self.month.frame = CGRectMake(monthX, monthY, monthW, monthH);
    

    
    CGFloat dayX = HJDWidth  - 40 -3;
    CGFloat dayY = 47;
    CGFloat dayW = 30;
    CGFloat dayH = 20;
    self.day.frame = CGRectMake(dayX, dayY, dayW, dayH);
    
    
    CGFloat yearX = HJDWidth - 30 - 20 -2;
    CGFloat yearY = CGRectGetMaxY(self.month.frame) + 5;
    CGFloat yearW = 40;
    CGFloat yearH = 20;
    self.year.frame = CGRectMake(yearX, yearY, yearW, yearH);
    
    CGFloat hengViewX = 0;
    CGFloat hengViewY = 101;
    CGFloat hengViewW = HJDWidth;
    CGFloat hengViewH = 1;
    self.hengView.frame = CGRectMake(hengViewX,hengViewY, hengViewW, hengViewH);

    
    
}



- (void)awakeFromNib {
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
